<include file="Public:top" /> 
<script src="__PUBLIC__/Static/Uploadify/jquery.uploadify-3.1.min.js"></script>
<link href="__PUBLIC__/Static/Uploadify/uploadify.css" rel="stylesheet">
<link rel="stylesheet" href="__PUBLIC__/js/treeview/jquery.treeview.css" />
<script src="__PUBLIC__/js/treeview/jquery.cookie.js"></script>
<script src="__PUBLIC__/js/treeview/jquery.treeview.js"></script>
<style>
.imagelist{}
.imagelist li{
    background: none repeat scroll 0 0 #F0F0F0;
    border: 1px solid #E0E0E0;
    display: inline;
    float: left;
	margin-right:10px;
	margin-top:5px;
    padding: 11px;
    width: 200px;
	height:250px;
	overflow:hidden;
	position: relative;
	
}
.imagelist li em{
    color: #999999;
    display: block;
    line-height: 18px;
    padding: 8px 0px;
}

.imagelist li span.txt {
    color: #FFFFFF;
	display:none;
    line-height:25px;
	height:25px;
    width: 200px;
	text-align:right;
	position:absolute;
	top:0px;
	right:0px;
}
</style>
<script>
	$(function(){
		$("#browser").treeview({			
		  animated: "medium",
		});	
		$("#image_result").sortable();
		$('.imagelist li').live({
		   mouseenter:
		   function()
		   {
			  $(this).find('.txt').css('display','block');
		   },
		   mouseleave:
		   function()
		   {
			  $(this).find('.txt').css('display','none');
		   }
		});
		
		$("#upload").uploadify({
			height        : 30,
			swf           : '__PUBLIC__/Static/Uploadify/uploadify.swf',
			uploader      : '{:U("Uploadify/upload")}',
			width         : 120,
			buttonText	  : 'Upload',
			auto		  : true,
			removeCompleted: false,
			onUploadSuccess: function(file, data, response) {
				$('#progress').hide();
				var result = $.parseJSON(data);
				//错误处理。。。
				if(!data){alert(file.name+'上传失败'); return false;}
				if(result.status == 0){
					alert(file.name+result.message);
					return false;
				}
				//上传成功
				var id = Math.random().toString();
				id = id.replace('.','_'); //生成唯一标示
				var html = '<li class="imageitem" id="'+id+'" style="padding:10px;background:#FFF">';
					html+= '<input type="hidden" name="file[]" value="'+result.file_name+'">'; //隐藏域，是为了把图片地址入库。。
					html+=  '<span class="txt">';
					html+=  '<a title="del" href=javascript:remove("'+result.file_name+'","'+id+'");><img src="__PUBLIC__/Static/Uploadify/remove.png" /></a>';
					html+=  '</span>';
					html+= '<img height="200" width="200" src="'+result.file+'" />';
					html+=  '<em><textarea style=" height:20px;width:155px;" name="htmlcontent[]">'+file.name+'</textarea> </em>';
					html+=  '</li>';
				$('#image_result').html(html);
			},
			onUploadStart: function(){
				$('#progress').empty().append('<img src="__PUBLIC__/images/load.gif">');  //用户等待提示。
				$('#progress').show();
			},
			onInit: function (){  
				$("#upload-queue").hide(); //隐藏上传队列                
			}		
		});
	})
	function remove(file,id){
		$.getJSON('{:U("removeImg")}',{file:file},function(data){$('#'+id).remove()})
	}
	function removePic(id){
		$.getJSON('{:U("removePic")}',{id:id},function(data){$('#b_'+id).remove()})
	}
</script>       
	</head>
  
	<body>
    
    <div id="body-wrapper" > <!-- Wrapper for the radial gradient background -->		

        <!--left start-->
		
        <include file="Public:left" /> 
        <!--left end-->
        
        <!-- End #sidebar -->			
		<div id="main-content"> <!-- Main Content Section with everything -->
        <div  id="header_logo">{:C("SITE_INFO.name")}</div>	 		
			
			<!-- Page Head -->
			<div style="float:left;">
			<h2>{$infoList.name} 的资料</h2></div>

			<div class="clear"></div> <!-- End .clear -->
                <!-- Insert -->
                <div class="content-box">				
                    <div class="content-box-header">                    
                        <ul class="content-box-tabs">						
                            <li><a href="#tab1" class="default-tab current" style="text-transform:capitalize">General</a></li>
                        </ul>
                        <span class="insert" style=" float:right; line-height:40px; font-size:14px; font-weight:bold;"><a href="{:U('index')}">List </a>&nbsp; &nbsp; </span> 		                            	
                        <div class="clear"></div>
                    </div>
                   
                    <form id="form" action="{:U($action)}" method="POST" name="editForm" enctype="multipart/form-data"> 
                    <div class="content-box-content">		
                        <div class="tab-content default-tab" id="tab1"> <!-- This is the target div. id must match the href of this div's tab -->	
                        <div id="sub_tabs"> 
                            <div class="tabs" id="tabs2-{$vo}">                                    
                            <table width="100%" border="0" cellspacing="0" cellpadding="0" class="editContent">
                              <tr>
                                <td class="fieldText">会员编码:</td>
                                <td>
                                	<input class="text-input small-input" value="{$infoList.member_id}" style="width:590px!important"  type="text" id="member_id" name="member_id" /> </td>
                              </tr>

                              <tr>
                                <td class="fieldText">名称:</td>
                                <td>
                                	<input class="text-input small-input" value="{$infoList.name}" style="width:590px!important"  type="text" id="name" name="name" />
                                	
                                </td>
                              </tr>

                              <tr>
                                <td class="fieldText">电话:</td>
                                <td>{$infoList.tel}
                                	<!-- <input class="text-input small-input" value="{$infoList.tel}" style="width:590px!important"  type="text" id="tel" name="tel" />
                                	<input type="hidden" value="{$infoList.tel}" name="telold" />	 -->
                                </td>
                              </tr>

                              <tr>
                                <td class="fieldText">注册时间:</td>
                                <td>{$infoList.join_date}<!-- <input class="text-input small-input" value="<if condition="($infoList['join_date'] eq '')"><?php echo (date("Y-m-d H:i:s")); ?> <else /> {$infoList.join_date} </if>" style="width:590px!important"  type="text" id="join_date" name="join_date" /> --></td>
                              </tr>

                              <tr>  
                                <td  class="fieldText" style="vertical-align:top;">账户余额:</td><td> 
                                {$account}
                                   <!--  <select id="grade" name="grade"> 
                                        <option value="-1">请选择等级</option>
                                        <foreach name="allGrade" item="vo">
                                            <option value="{$vo.name}" <if condition="$vo['name'] eq $infoList['grade']"> selected="selected"</if>>{$vo.name}</option>
                                        </foreach>
                                    </select>  -->
                                </td>
                              </tr>

                              <tr>
                                <td class="fieldText">交易评价:</td>
                                <td>
                                	{$point}
                                </td>
                              </tr>
							  <tr>
                                <td class="fieldText">黑名单次数:</td>
                                <td>
                                	<input class="text-input small-input" value="{$infoList.black_count}" style="width:590px!important"  type="text" id="black_count" name="black_count" />
                                </td>
                              </tr>
                              <tr>
                                <td class="fieldText">微信昵称:</td>
                                <td>
                                 
                                {$infoList.nickname}<!-- <input class="text-input small-input" value="{$infoList.nickname}" style="width:590px!important"  type="text" id="nickname" name="nickname" /> --></td>
                              </tr>

                              <tr>  
                                <td  class="fieldText" style="vertical-align:top;">性别:</td><td> 
                                   <if condition="1 eq $infoList['sex']">男<else/>女</if>
                                    <!-- <select id="sex" name="sex"> 
                                        <option value="-1" selected="selected">请选择性别</option>
                                        <option value="1" <if condition="1 eq $infoList['sex']"> selected="selected"</if>>男</option> 
                                        <option value="0" <if condition="0 eq $infoList['sex']"> selected="selected"</if>>女</option> 
                                    </select>  -->
                                </td>
                              </tr>
                              <tr>
                                <td class="fieldText">会员头像:</td>
                                <td>
                                 	<img src="{$infoList.headimgurl}" style="width:200px;" /> 
                                 </div>                             
                                </td>
                              </tr>
                            </table>    
                            </div>
                        </div>
                        </div> <!-- End #tab1 -->
                    </div>  
                    <div style="padding:0 0 20px 20px">  
                        <!-- Yang id change uid 0617 -->
                        <input name="uid" value="{$infoList.uid}" type="hidden"/>
                        <input class="button" style="text-transform:capitalize" type="button" name="BtnSave" onClick="formSubmit()"  value="保存" />&nbsp;&nbsp;
                        <input class="button" type="button" name="back" onClick="window.location.href='{:U('index')}'"  value="取消" />
                    </div>  
                    </form>     
                </div> 
                <!--End Insert -->
			
			<div class="clear"></div>
			
			<!-- Start Notifications -->
			
			<!-- End Notifications -->
			
            <div id="footer">
				<small> <!-- Remove this notice or replace it with whatever you want -->
						&#169; Copyright 2015
				</small>
			</div>
			
			<!-- End #footer -->
		</div> <!-- End #main-content -->
	</div>
	
	<script>
    $(function(){
        $('.content-box-content ul.tab-content').hide(); // 先隐藏DIV
        $('ul.content-box-tabs li a.default-tab').addClass('current'); // 给默认的选项卡加样式
        $('.content-box-content ul.default-tab').show(); //
         
        $('ul.content-box-tabs li a').click( //
            function() {
                $(this).parent().siblings().find("a").removeClass('current'); //
                $(this).addClass('current'); //
                var currentTab = $(this).attr('href'); //
                $(currentTab).siblings().hide(); //
                $(currentTab).show(); //
                return false;
            }
        );
         $( "#sub_tabs" ).tabs();  
    });

   
    function formSubmit () {
        if ( $("#name").val() == -1 ) {
            alert('是否启用没有选择');
            return;
        };

        $("#form").submit();
    }

    </script>
	
	</body>
</html>
